﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="SearchTraining.ascx.vb"
    Inherits="WebForm_SearchTraining" %>
<%@ Register Src="~/WebForm/CommonControl/VolunteerQueryControl.ascx" TagName="VolunteerQueryControl"
    TagPrefix="uc1" %>
<%@ Register Src="~/WebForm/CommonControl/AnnualControl.ascx" TagName="AnnualControl"
    TagPrefix="My" %>
<div align="center">
    <table width="95%">
        <tr>
            <td class="Section" align="left">
                <asp:Label ID="lblVolunteerQueryCondition" runat="server" meta:resourcekey="lblVolunteerQueryCondition"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <table>
                    <tr>
                        <td align="left">
                            <uc1:VolunteerQueryControl ID="VolunteerQueryControl1" runat="server" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="Section" align="left">
                <asp:Label ID="lblTrainingCourseQueryCondition" runat="server" meta:resourcekey="lblTrainingCourseQueryCondition"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <table width="100%">
                    <tr>
                        <td align="right">
                            <asp:Label ID="lblYear" runat="server" meta:resourcekey="lblYear"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="ddlYear" runat="server" AutoPostBack="true" >                                
                            </asp:DropDownList>
                        </td>
                        <%--                        <td align="right">
                            <asp:Label ID="lblUOrganizationID" runat="server" Text="<%$ Resources:UOrganizationID %>"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="ddlUOrganizationID" runat="server" DataSourceID="ObjectDataSource_UOrganizationData"
                                DataTextField="OrganizationName" DataValueField="UOrganizationID">
                            </asp:DropDownList>
                            <asp:ObjectDataSource ID="ObjectDataSource_UOrganizationData" runat="server" OldValuesParameterFormatString="original_{0}"
                                SelectMethod="BLL_Select" TypeName="BLL_DirectOrganizationData"></asp:ObjectDataSource>
                        </td>--%>
                     </tr>
                     <tr>
                        <td align="right">
                            <asp:Label ID="lblGroupType" runat="server" Text="<%$ Resources:lblGroupType %>"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="ddlGroupType" runat="server" AutoPostBack="true">
                                <asp:ListItem Text="-- 全部 --" Value=""></asp:ListItem>
                                <asp:ListItem Text="基礎訓練" Value="B"></asp:ListItem>
                                <asp:ListItem Text="特殊訓練" Value="S"></asp:ListItem>                                
                            </asp:DropDownList>
                        </td>
                     </tr>
                     <tr>
                        <td align="right">
                            <asp:Label ID="lblGroupID" runat="server" Text="<%$ Resources:lblGroupID.Text %>"></asp:Label>
                        </td>
                        <td align="left">
                            <My:MyDropDownList ID="ddlUOrganizationID" runat="server">
                            </My:MyDropDownList>
<%--                            <My:TableDataSource ID="odsGroupID" runat="server">
                                <SelectQuery>
                                    <MyTable TableName="TrainingCourseGroup" AliasName="tcg" />
                                    <MyColumns>
                                        <My:MyColumn ColumnList="tcg.ID, GroupName = right('0'+CONVERT(varchar,Year(tcg.StartDate)-1911),3) + '/' +  right('0'+CONVERT(varchar,Month(tcg.StartDate)),2) + '/' +  right('0'+CONVERT(varchar,Day(tcg.StartDate)),2) +' '+tcg.GroupName" />
                                    </MyColumns>
                                    <MySortColumns>
                                        <My:MySortColumn ColumnName="tcg.StartDate" />
                                    </MySortColumns>
                                </SelectQuery>
                            </My:TableDataSource>--%>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <asp:Label ID="lblRegStatus" runat="server" Text="<%$ Resources:RegStatus %>"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="ddlRegStatus" runat="server" DataSourceID="SqlDataSource1"
                                DataTextField="Text" DataValueField="Value">
                            </asp:DropDownList>
                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:connStr %>"
                                SelectCommand="SELECT [Value], [Text] FROM [CodeMapping] WHERE (([TableName] = @TableName) AND ([ColumnName] = @ColumnName))">
                                <SelectParameters>
                                    <asp:Parameter DefaultValue="TrainingRegister" Name="TableName" Type="String" />
                                    <asp:Parameter DefaultValue="RegStatus" Name="ColumnName" Type="String" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <asp:Label ID="lblCheckStatus" runat="server" Text="<%$ Resources:CheckStatus %>"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="ddlCheckStatus" runat="server" DataSourceID="SqlDataSource2"
                                DataTextField="Text" DataValueField="Value">
                            </asp:DropDownList>
                            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:connStr %>"
                                SelectCommand="SELECT [Value], [Text] FROM [CodeMapping] WHERE (([TableName] = @TableName) AND ([ColumnName] = @ColumnName))">
                                <SelectParameters>
                                    <asp:Parameter DefaultValue="TrainingRegister" Name="TableName" Type="String" />
                                    <asp:Parameter DefaultValue="CheckStatus" Name="ColumnName" Type="String" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </td>

                    </tr>
                    <tr>
                        <td></td>
                        <td align="left">
                            <asp:Button ID="btnQuery" runat="server" Text="<%$ Resources:Query %>" />
                            <asp:Button ID="btnExport" runat="server" Text="<%$ Resources:Export %>" Width="88px" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>
<My:MyGridView ID="GridView1" runat="server" SkinID="pager" AllowHoverSelect="False"
    AllowHoverEffect="True" MySortDirection="Ascending" AutoGenerateColumns="False"
    meta:resourcekey="gv">
    <Columns>
          <My:VolunteerIDBoundField DataField="VolunteerID" HeaderText="<%$ Resources:VolunteerID %>"
            ReadOnly="True" SortExpression="VolunteerID" />
        <asp:BoundField DataField="VolunteerName" HeaderText="<%$ Resources:VolunteerName %>"
            SortExpression="VolunteerName" />
        <asp:BoundField DataField="StartDate" HeaderText="<%$ Resources:StartDate %>" SortExpression="StartDate" />
        <asp:BoundField DataField="GroupTypeText" HeaderText="<%$ Resources:GroupTypeText %>"
            SortExpression="GroupTypeText" />
        <asp:BoundField DataField="GroupName" HeaderText="<%$ Resources:GroupName %>" SortExpression="GroupName" />
        <asp:BoundField DataField="AllHour" HeaderText="<%$ Resources:AllHour %>" SortExpression="AllHour" />
        <asp:BoundField DataField="RegStatusText" HeaderText="<%$ Resources:RegStatusText %>"
            SortExpression="RegStatusText" />
        <asp:BoundField DataField="CheckStatusText" HeaderText="<%$ Resources:CheckStatusText %>"
            SortExpression="CheckStatusText" />
    </Columns>
</My:MyGridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
    SelectMethod="BLL_Select" TypeName="BLL_ManageTrainingRegister_SearchTraining">
    <SelectParameters>
    <%--    <asp:Parameter Name="Region" Type="String" />
        <asp:Parameter Name="Region2" Type="String" />--%>
        <asp:Parameter Name="UOrganizationID" Type="String" />
        <asp:Parameter Name="VOrganizationID" Type="Int32" />
        <asp:Parameter Name="VolunteerId" Type="String" />
        <asp:Parameter Name="VolunteerName" Type="String" />
        <asp:Parameter Name="TEL" Type="String" />
        <asp:Parameter Name="RegStatus" Type="String" />
        <asp:Parameter Name="CheckStatus" Type="String" />
        <asp:Parameter Name="GroupID" Type="String" />
        <asp:Parameter Name="Annual" Type="String" />
    </SelectParameters>
</asp:ObjectDataSource>
